package br.com.fip.si.praticas.teste;

import static junit.framework.Assert.assertEquals;

import org.junit.Before;
import org.junit.Test;

import br.com.fip.si.praticas.modelo.Bolao;
import br.com.fip.si.praticas.modelo.Usuario;

public class UsuarioTest {
	
	private Usuario u;
	private Bolao b, bo,bolao;
	@Before
	public void setUp() throws Exception {
		u = new Usuario("Diego", "398275", "diego", "456");
		u.setPontuacao(10);
		b = new Bolao(1, "Semi-Final");
		bo = new Bolao(2,"Final");
		u.addBolao(b);
		u.addBolao(bo);
		bolao = u.selecionarBolao(b);
		u.removerBolao(2);
	}

	@Test
	public void testGetNome() {
		assertEquals("Diego", u.getNome());
	}

	@Test
	public void testGetCpf() {
		assertEquals("398275", u.getCpf());
	}

	@Test
	public void testGetPontuacao() {
		assertEquals(10, u.getPontuacao());
	}

	@Test
	public void testSetPontuacao() {
		assertEquals(10, u.getPontuacao());
	}

	@Test
	public void testAddBolao() {
		assertEquals(1, u.getBoloes().size());
	}

	@Test
	public void testSelecionarBolao() {
		assertEquals("Semi-Final", bolao.getNome());
	}

	@Test
	public void testRemoverBolao() {
		assertEquals(1, u.getBoloes().size());
	}

}
